/**
 * texture.h
 * 
 * @author Zsolt Horváth 
 * @date   3. 4. 2011
 * 
 */

#ifndef TEXTURE_H_
#define TEXTURE_H_

#include <string>

#include <GL/glew.h>
#include <GL/glu.h>

using namespace std;

/**
 * OpenGL texture
 */
class Texture {
    
    public:
        /**
         * Constructor
         */
        Texture (GLint internalFormat, GLint format);
        
        /**
         * Desctrutor
         */
        ~Texture ();
        
        /**
         * Set parameters of texture
         * TODO solved this normally, should with parameters
         */
        void setParameters ();
        
        /**
         * Bind texture
         */
        void bind ();
        
        /**
         * Bind using texture unit
         */
        void bind (GLenum texture);
        
        /**
         * Set size of texture
         */
        void setSize(unsigned int width, unsigned int height);
        
        /**
         * Set name of texture
         */
        void setName (string name);
        
        /**
         * Get name of texture
         */
        string getName();
        
        /**
         * Get texture ID
         */
        GLuint getID();
        
    protected:
        
        /**
         * Specifies the target texture
         */
        GLuint id;
        
        /**
         * Specifies the number of color components in the texture
         */
        GLint internalFormat;
        
        /**
         * Specifies the format of the pixel data.
         */
        GLint format;
        
        /**
         * Texture name
         */
        string name;
        
        /**
         * Generate new texture
         */
        void generate ();
        
};

#endif /* TEXTURE_H_ */